Ugh, that is horrible spaghetti code.