improved example JS script for launchpad