clean up.

quick clean up. extracting point difference calculation to it's on
method.
keep track of old positions with array
moving some details.
adding comments
renaming