changed func calls to pass variable