removes extraneous text from diagram