added movement loop