Added comments and names to anonymous function

This is to follow the advice in:
https://github.com/airbnb/javascript