Compound key isn't the right term; it's composite key. Updated comments and streamlined code a bit.