Can this method be placed directly on the algorithm class and be inherithed to the two algorithms