Finished basic program functionality

--Added safety features to dialogs
--Ensured all functions work correctly
--Performed code cleanup; removed unneeded code, and warnings.
--Removed extra variable declarations
TODO: Finish code cleanup, add file write capability.