ported calc4b and rule2 test