a lot of pointless renaming, but the data structures are probably closer to what i want now