factorial solutions