Create statistics and sort