added/modified comments + used better internal names + other minor fixes
changed collectionView sort to perform less array operations