AZ and inverse AZ functions working accurately