move mode char stuff to main