improved the code example