changed variable names to match Patrick's.