cleanup printing
fixed key derivation stuff