Improve on logic flaws in userRefineInput. need to debug further