Overall heavy on memory (might be okay), looks like when plotting repeatedly allocated memory is not freed