Added functional example and tests.