some of the worst coding ive ever done.