trying to work out data structures