fixed small bug in z