fixed some stuff. Rotation broken. Need to find a better solution
Closing figure kills main loop