proper spawn function

Is this what you wanted?