Created a function for the Gordon-Hall algorithm.