Added diagonals algorithm using array overload