demo re function for stats