Liking this, any test cases I might be missing here? https://gist.github.com/anonymous/c3588cdfd25722787799