How does carbon dating work