Try eliminating the *(2/3) first line in the UpdateLevel() function
replace the line with:
MaxA = ((Level + 2)^2)
Since the expression is an integer (2/3) doesn't return 0.66 but returns zero instead
replace the line with:
MaxA = ((Level + 2)^2)
Since the expression is an integer (2/3) doesn't return 0.66 but returns zero instead