How horseshoe crabs evolved into spiders