So... the right solution is just to do it again the Right Way, you say?
This isn't the right case all the time, but if implementing something is only a few dozen lines and isn't already provided in an appropriate form by a library that you're using, there's nothing wrong with just implementing it from scratch.