Added comment to destructuring function.
Rewrote and simplified the destrucuring function.