Also simplified some parts of the algorithm implementation Part of this simplification involves the use of goto statements