iterative factorial working. still need to clean up coupling of type checking and ast annotation