Changed function name and added some comments.