Fixed curly braces, added comments