Completed functionallity. readData(), outputData()