simulating a billiard.