create class for the algorithm