removes cruft and adds comments