Moved the updatePosition method out of the constructor