Second version of the Main.rb and fix bug with Matris.rb