Added a second input

and fixed a little bug with operator precedence