rewritten with dictionaries
rewrite with dicts instead of classes, Stokes DC works