added use of currentZ when lines are drawn