New code with new z value