added ballsbouncing code to latex and cleaned it up to be finished