Quick tidy up. Now just need to speed the thing up.