passing state through functions
…