improved function and class definitions.