Initial actually working software
Reindent with 'indent -kr -nut -ts4'