Updated JS file with new features