basic fork implementation