Finalized the wrapper function