tweeks. added the normalize pgm which was a gist that I forgot about