remove lots of cruft, add comments