added debug statements in case of invalid moves