replaced tabs with spaces, added 'use strict', removed unused var, fixed assignment bug