moved key writing step to install, added some arity to shell scripts
for better debugging
fixed chmod step