static cast on count
Better use of DEBUG in main, consistent logical operators