Some work on functions, but far from finished