Recombined into one findBestDirection() function to avoid code repetition.  Also wrote the findBestDirection() function.