Moved header stuff to separate file. Added input system for write mode.