additions and changes to plotting functions