fix various bugs
all tests now work...

onto compression!