Solution #3, CSE 191