added draft implementation to deterministic selection and test