replace brackets with let & in