update the buy function
Merge pull request #15 from ycj28c/master

update the buy function