adds logic to UI elements, app is now working