added main file, main/graphgen, and fixed mysterious issues with compliation into an executable