calculates correctly for multiple operators and handles decimals