created abstract algorithm class