Added the functionality of showing Ads and pagination.