fixed while end condition. Only draw if count > 0