Added function to substitute variables in let forms