functions to work with data structure done