implemented comparator for deciding who's attacking first