started a complete rewrite of model