almost finished funtion of pzZyEjzb