moving the algorithm on a class by themselves