actually working code (6-ply depth)
cleaner printf()s