Cleanup help, added Dennis' K parameter code, changed get_k prototype to suit