add some helper functions for plotting