Added least and greatest functions