naive code