Inefficient solution