added formatting and emptying