Added tests, added example code and documentation