changed index of pieces to start at 0 instead of 1