rename some variables to match blog code