Added read_frame_from_file function