tweak clan algorithm