Added variables for the keysums to make the code easier to read.