re-adding main activity stuff
omitted some code that seemed no longer needed