More useful functions that I wish I'd put in before