Added more documentation, together with example code