Added some more testing and write out the ssh key