cleaned up legend