Tidied up the code.  Improved optional.