Define factorial and Out of

Fix tests