Added references, symmetry optimizations.