Changes to layout and speedup to engine code (not working fully now, but will fix soon)