i wrote this code on a train without internet. it's so bad.

save yourself and just don't read the changes. it's horrible.