Rename function and add comments for greater clarity