writing basic data structures in js, just for fun