change return type from double to int for EntityFanctions.DeffXXX