a lot of fixes

memory usage improvements, graphical fixes