Thanks for this. Added on some extra functionality. Here's the [gist](https://gist.github.com/austospumanto/63d8e3f3b75626999496977806c712a6)