add methods in main activity and new changes in layout settings