algorithm begin