Refactoring of Vose's Top-Down.c