try to use char variables instead of global