updated logic.js, now handling first position of moving piece