introduced a select function