fixed parens, fixed flag logic, added protocol for curbing escessive constant increase