If you need the full implementation spelled out I can do that when I get in from my commute home.
Interesting task I guess really you want to find the first (from right) and move the first set bit left to fill it.