more efficient role calculating (no more calculating one role multiple times)

also fixed output of calculated role when role was not dirty
might fix occasional CME