fixed bug in plotting routine introduced during previous edits