added some more complex functions and tests