many fixes including messing around with indexes