a simple implementation of Genetic Algorithm