Source: http://www.newyorker.com/magazine/2014/09/08/masked-avengers&
He later stated that “The Confederates were now our countrymen, and we did not want to exult over their downfall.”
Source: https://en.wikipedia.org/wiki/Battle_of_Appomattox_Court_House
Jump to 4:19 for the math behind it… the whole video is very informative in and of itself too.
Those two states use the “Congressional District Method,” where electors are decided by popular vote in each congressional state district, and two electors determined by statewide popular vote.