refactored
Added code to handle pi data, modified some fio data code