added logic to select numbers
Logic is working correctly