writing dump code