Fixed minor bug and improved output