fixing data structures