finished fixing data structure