cleanes up app file and adds more comments