adding buttefly function