created new ADS implementation with lesser memory use