clean up, add comments