Cleaned up the code a little. Changed the condition in the split function to better match the conditions of hitting the goal.