change program.rb name to test.rb; some minor refactoring