refactored forkWorker, much cleaner now