Updated DIIS in RHF to a cleaner format and removed duplicate code