 
     counts
 
-  sortUnread: (unreadEntries) ->
+  sort: (entries) ->
     if @data.entry_sort == 'ASC'
-      unreadEntries.sort (a, b) =>
+      entries.sort (a, b) =>
         @published(a) - @published(b)
     else
-      unreadEntries.sort (a, b) =>
+      entries.sort (a, b) =>
         @published(b) - @published(a)
-    unreadEntries
+    entries
 
   markEntryRead: (entryId, feedId) ->
     # total unread

            @byTag[tagId].splice(entryIndex, 1);

  markEntryUnread: (entryId, feedId, published) ->
    unreadEntry = [feedId, entryId, published]
    @unreadEntries.push(unreadEntry)
    @unreadEntries = @sortUnread(@unreadEntries)
    counts = @organizeCounts()
    @byFeed = counts.byFeed
    @byTag = counts.byTag
    @unread = counts.all

    object[item[0]] = item[1] for item in tagArray
    object

  feedId: (entry) ->
    entry[0]

  entryId: (entry) ->
    entry[1]

  published: (entry) ->
    entry[2]

  buildEntry: (params) ->
    [params.feedId, params.entryId, params.published]

class Counts
  instance = null
