Diagonalizer now works as it should, with multiple groups