ugly progress. made index mutable reference so my funcs could do crappy side effects so i can go step by step