Added more comment, and simple example how to use the function