solved problem 92 (inefficiently)