added comment parsing and improved output