tidy up adding some comments and right require for gmail