todo function working in basic form
todo function improved for non-existent file