cleaned up algorithm removed redundant scheme analysis

* moved unnecessary information from the try/except. Removed the
best_score calculation from each loop of the algorithm and placed
before the while loop.