reverse nullcheck ordering to prevent nullpointerexceptions in headerstring parsing
clean up header and add basic directory browswer