Now works perfectly in ie9 and above, and close to perfect in ie8