read data and mangle