Updated to read whole file instead of lines