modifying the given apple CollectionView sample project from https://developer.apple.com/LIBRARY/IOS/samplecode/CollectionView-Simple/Introduction/Intro.html#//apple_ref/doc/uid/DTS40012860-Intro-DontLinkElementID_2