added  implementaion and delegate code to DetailViewController