Some code cleanup - Added a few more functions for aiding in the solving algorithm