Change separator Function

Used a very simple straightforward function that gave the answer
needed, tested and fixed.