Overhaul to make it work on Chrome 35