handeling binary and unary rules now