updated read_dem a bit, removed the changes I made for genarthack