i am ashamed of this code