added min and max functions to collection