How does magnetic dating work