Cleaned up whitespace.
Replaced tabs with spaces.
Wrap in an anonymous function that can be rescoped.