Update code to make piece positions match array indices