added javascript ball rendering