naive solution complete