created init function with process function as a callback