Additional utility functions

Added delta encoding and frequency calculation