added autocalculation