Fix and reorganized classes. Preferences have also been added and some changed to activity