some code polishing, description comments added