Added a function to handle given delimiter