eww, what the heck did I do back then? make my code do this stuff in a somewhat saner way