Numbering within model

Take numbering of periods out of controller and put into model.