minor revision for efficiency