Neat trick, but I'd like to ask you to use != 1 instead of the ~ operator to make it easier to grasp.