A few changes/additions

A tidy version of #57 + some code formatting