new improved version
fix2
better sequential sorting