redoing some code so that goto's are line agnostic