Changed some things around so the app can pause and resume properly.