fixed generalizedLucas, passing current tests