Added some code for attack