small error in plotting code