Adding most of the helper functions for read function.