fixed tests, fixed example and added some comments