improved instant mix algorithm