Added matrix method to Array prototype