added some reference
added templating
added reference for closure