Implemented working GA-alg.