key exchange also implememted