improved for calculating expressions