removed debugging printouts
tweaked for loops, but pb remaining