added some basic piece checking