completely rewrote code; i was a retard back then