Updated code to use collection view