Implement Selection Algorithm