Added 'count' function.