Restructured for comparision of algorithms.