fixed if braces && add some comments