documenting fork handling algorithm