Same comments on this function as the one above.