working version of app with txt file database