Added deadendfiller. Also added helper function for testing