Added purchase function, only partial.