still not updating indices correctly. need to get back to this after a little sleep