Working on logic of new calculator