Added binary search function and functionality needed for registration of pubkey