rewrote select and reject