implementing calc