Code to find Zs