Mr Proper, algorithms apparently do what I asked for but give strange results