oops fix bug: change data structure so that we don't care about the 
number of element and the ids