add an image to test with, cleanup code a bit and add comments