finished calculator functions