implemented phase 2 calculation for position