updated article to use better code