move saving to db into functon (in progress)
function for saving app status and position
added comments & function calls