code cleanup and comments added