created input version of function.

also separated out the weasel version of the function.