genprog needs to work in reverse