Refactored iterate prompt

Now only one fuction that accepts a parameter to determine math type.