added test example
added tests and fixed pretty output