use much less RAM with new structure

also use chained list to store data