Added StatHat code