1) added % and ^
2) fixed brackets while handling operators
3) sent calculating in a function