Here's version 2 and its output