absolutely fucking awful code, I'm sorry.