Modified to use Ruby 1.8.7, changed parsing a bit