The program now prints out a correct image.