combine real and discrete algorithms under one class