Updated file I/O and made window resizable