adding some bullet proofing on calc and better inputs