Cleaned Up Code

Replaced if inside of else with else if
Added Error Check

Added method to ensure that levelCount doesn't overflow