Tidied up code

Simplified code by adding columns manually rather than trying to detect
properties, plus a few other tweaks.