changed everything to use provider object
changed everything to use provider object