Initial code for computing all models and writing them to the database