sort flags/commands, print text on succesful updates. fix mousetrap when before is nil