fixed comments, permission checking style