Added some code to Attack function