explain algorithm