I used my library for this, so it saved me a lot of time. I intend to release it open source someday, maybe, once I clean it out!