implement glue with genetic algorithm