Removed global variable k_current