code cleaning - looping through pixels. doesn't compile