More sensible variable names and cosmetic improvements