Data structure related stuff and code