added calculateAll() method