Add comments, clean up codes