added ability to use private keys