Rename the ambiguous variables

Change the ambiguous variable such as tmp and tmp2. Adopt the clear and readable variable names instead.