Reworking function that includes html5 shim