added functions to the model and more work on the shift template