If beauty and precision is important, perhaps this will give you some ideas.
If the solution needs to be simple and fully Coda-bound, this might be a good read.