add functions to get the maximum and average values for a crate