updated Data Structures, fixed some bugs.