added workspace class for memory issues
fixed error in compression algorithm