clean up, comments, fixed a link entities bug