delete excess brackets