Wrote and tested u_function. Probably overkill for this pset.