Rewrote fallback for older browsers to support grouping