changes to selection logic