Adding main activity and cleaning up