Finshed first implementation of model selection by windowing