adding code t fight function