Better data structure and some test