rewrote main Activity

rewrote main activity after watching video. Persistence is now properly
functioning.