re-organize and comment code, directory structure