optimized again. now converts all data on fly to flat format. speed option deprec
removed speed flag.
modes a bit modified