added class for sequential version of the program