REDOING state space model. Main script is run.SS.model.R