Use std::abs instead of fabs
rename variable, because i is already used in that context
Implement entity count in Yasp

code by Oliver Sander ported to new Yasp