Just refactored the code a bit and added some comments.
Authored by: hemmecke 2008-06-13
Parent: [r296]
Child: [r298]