Added comments, reviewed the code, changed the author name.