Text this: A second-law-based optimization