Replaced right/leftshifts with AND and OR to render negative numbers impossible. Also provided functionality for computing the expression with a certain value for the variable