added some of bondy's javascript