changed IO and implemented gridfunction (TS)