Yep,he purloined the idea and reshaped it, to suit his own purposes. JRR did the same thing with many of his plot twists and characters. Tolkien was not nearly as clever and inventive as you think he was.
To be fair, other authors have done the same thing.:-)
It might not be original..... but its a darn good story