Added zipping, flushing and improved build