Working naive code