change function types to account for string pinhash