refactoring in place.  still needs testing and absolute position calculation