autogeneration almost working...