added a loop for multiple checks on the same run
added a loop for multiple checks on the same run
added an if check so the program does not evaluate at n = 0, it caused a seg fault
program quits when n <= 0