changed layouts and implemented code in activity