Alright got it working, time to clean up and comment code