Added footer functions. Fixed data reading bug.