add buy logic