legend. pdf output. clean up.