code for detailed view and comments