actually, in general what does this function do and why do we need our own implementation of it?