converted the seriation method to python. now testing