Made the program generator work for single functions