Moving the stat function to the right place.