final version including calculator