polishing up the code1