tutorial working in ie10. Replaced .map and .indexOf with jQuery versions