Gave some temporary variables better names too.