Remove duplicate 'trim' function. Fix indentation.