This is slower but works better.