modified several variable name for better understanding.