simplifying plotting routine