add matrix operation in ruby