reduced some of the math
added some more comments
added a variable called myspread to hold mymax - mymin value