Your solution looks simple and easy to follow. There's a flow chart to simplify this process here: https://xkcd.com/1987/