Rather than starting from scratch, why not just fork bcnc? It's already a great sender, and would be alot easier to modify rather than having to write everything from scratch.