change tabs to spaces and clean up code style (js hint)