reduced complexity of swizzle function