made generic functions common; began adding tests