correcting error in algorithm
solving P25