minor changes, added a chunkdictionarytofile function