updated blog post with better solution