Added buy function