Made changes to writing into zip file

Now writing directly into zip file instead of creating a copy and then
zipping that.