added function
changed structure