added file saving function, toasts, and alertdialogs