this code is a fucking mess

I'll fix it when I fix it.