Changed layout of code and code order, mostly in DrawingPanel