added third pass features, fixed reader to cope with new data formatting