Updated position calculation functions. New aproach solves almost all callback hell issues.... or at least it is on the good way to it...