Trying to debug the not working end of file stuff