swapped indices accidentally

as i am prone to doing :(
also removed some vestigial code