added memory monitor
cleaned up a bit