polished pasted piece of code