The contents of that function do exactly that.

If it's better readablility to paste the contents of the function instead I can.