added some comment + removed debug output.