implement the functions in modInput