what are the 4 main functions of minerals?