attack function and explore function added
Merged with code