compute return dict instead of list