Changed the Algorithm constructor and all subclasses