Data Structures, reimplement in JS