refactored to run on single image from command line. Better variable names