fixed switch inequality bug