imperative searn short and sweet, fixed memory leaks, and tests