added buy functionality