binomial coefficients space optimised