Fixed Vsync and entity inheritance. More testing in main file