fix head option (don't count the header)
remove debugging output