Merged JT's code into Ricky's wrapper