First working version of generate-manifest