Slight progress and tidy up. Testing soon.