Added logic to perform operations. Also added precedence and skeleton of button listeners