Updated MainActivity to create a dynamic layout