Add genetic cost function