finished iterative factorial