Cannibalized a next-state generator from an older homework