Cleaned code and delete two algorithms.