Fixed 
 issue and added train_z.
Implemented PL.