implemented algorithm