made the code faster by basically doing all my work from the past week in five lines... :(