Incorporating combinatorial geometry to the EGS5 code and its speed-up