working dot finding and column sorting