modified my solution