Made code much simpler

I used a goto, please don't hurt me.