fixed style, added comments