Optimised isTerminal and put, canPut by utilising bit board fully.