created base function to parse data, and base calculator class