Made optimizations

Optimized the code to run faster. Also added in code to vary the number
of candidate objects from 2 to 10. Also computed some results.