20130921: Working copy of the chunk_factory.pl