Adding preamble. Some tidying.