A Simple Algorithm for Data Compression in Wireless Sensor Networks