Minor changes and add comments