Created a read in function