Localization changes

Works now with new shared variables.
First version of the computations of the position.