replaced size with binomial coefficient range function