Complete rewrite of backward.c