Updated to include polyfill for older browsers