refactored cpp code and added 2 intensity compression algorithms