changing powers-of-2 to powers-of-n