Fixing bugs in code. Having trouble running factorial