polished check.rb and added output formats