GAAAAAH i am an idiot (and so is javascript)