Finished Hu T.C. Algorithm