Fixed my bug. Sorry.
Started tidying up code.
Minor changes.