added compress and uncompress functionalities