Adding more code to determine the best method of action.