added gzip method. added post processing logic. few other changes