initial implementation including tests
adding example and docs