Moved functionality from FixedUpdate