fixing mismatched brackets and unnecessary defun*