Update to Pierre's javascript