restructures and adds comments