initial flipclip algorithm