Moved position and angle control to a function. Cleaned up stuff a bit.