Feature #6: Implement the basic logic in the index() method of AdController. Also, modified the view templates to accomodate this change.