optimised nim-value function