Fixed GA code