Quick fix for else if statements and changing the way regex is used