overhaul data structure for the model, started. Replacing everything with objects and functions instead of mappings