explain algorithm better