working on pyp_means algo