added a status screen and fixed buffer data being written into unallocated memory and file opening and closing