Added diag() method and new way to create array