algorithms implements