gets the pieces index working