Completely rewritten the RiskModel class