removed parameters and made global variables