Start main method. Minor tidy up