Update the code with better coding style
updated coding style