added code to check for some basic chess rules and added a basic unit test