Add some poorly organized plotting code