Added function illegalMove