added read file codes