changed some vars to static