bug fixes/ui minor

made changes in how some precedures are done including delete file.
Look at code comments for details