included sigma2z function in function.py