Been doing some tweaking, added some comments and doing some tidying up.