added StatHat code