read data refactored
completed basic io facility