Improve logic in README code example