my solution to this problem