Added the main function to implement the CF Algorithm.