added simple selection function with correct definition