add core algorithms (forward and backward)