working on decreasing query