Self join working for all sizes