updated polished plotting routine