Added tests and improved output text