Replace mod with an equality check :(