Slightly cleaned up Matrix.rb