working private key derivation and cleaned up tests