added first impl filedecoding in chunks, but not working completely yet