Created the java file for the algorithm