modified main.rb. Added last method