polishing the code