Buy function seems to be working