made attacking work, fixed some bugs with defense