refactored tryFork() to use pre-existing helper functions