+ fixed some index bugs