Function for constructing stats table