Added basic control loop and fixed drawing stuff