Final tidy of script
Add some documentation, just in case someone does not speak Python - hiiiiisssss