added reading code.