queues removal using optimised join and also optimised window