simplified code to strip brackets to 1 line