add core algorithm