cast count to an int so that the comparison at the bottom of the while loop works correctly