code for dealing with simulator data