Initial work to get repeat 1 working better. Not yet finished