Finnished the script for generating all the possible candidates