Added file types
Better handling
Added headers for most basic stuff and some more comments.
Added txt file/plain header
renamed parameter