Version final - matrices-fixed.rb