A lot of shitty code, too sleepy to refactor