Made some entity function virtual
Added note entity and judging contents
Math helper function defines changed