added z correction