added reference to google docs, and fixed function scope