added plotting functions