added buynow function and related js