added new plotting code