Added more comments + minor changes.