calculator with checks