Data interpreter

altered to code all in one loop. must be tested before merged into master