adding z functionality