Changed functinos to allow other selectors.