Utility functions added
Redundant code removed
Count functions removed. Not working