implemented extra credit - half pixel - for homework 4