fixed bugs in data structures