removed reading a file with the buffer struct and instead used file operations