You could always read the code and see how the modules do it if you want to learn it for yourself. Don't be afraid to use modules if available. :)
I'm sure they also appreciate if you combine your efforts and submit any improvements regarding versatility and such to the existing code base as well.