Corrected separate functions to return dict