add decompressing of remaining data
split some functions
split functions