redesign of list sort algorithm and of the repaint method in picture. Not finished because it may be possible to make it even quicker by enhanced paintable checking algorihtm