Added z-func
Added z-func