simple but slow solution