Wrote analyze-key utility function.