trying to save some time in calculation