remove some printstatements and change a few loops
Merge