Re-implemented read code and test