Use dictionary comprehensions. Also fixes small bug in calcualte.

The bug fixed is that the calculation module was broken for a
checkbox count of other than 5.