Commenting and formatting z_init function