added readfile functionality