added GREATEST/LEAST functions