add a comment to explain this damn function