Integrated qsort() function & other cosmetic changes

1. Added soritng of virtual functions just to get better output.
2. Some code removal and other cosmetic changes.