How does an automatic weighing and packing machine work?