Implementation of the lookup and chaneing position