some improvements on the bullet javascript