added a plotting routine