use objects and rework the algorithm
use index to the memory footprint