Hello CODE WARRIOR!
I am wondering if you might be able to tell me a little bit more about what you are doing. If my guess is correct, you are attempting to reconstruct an image with knowledge of its histogram? I am not familiar with this algorithm, but if its the coding of the algorithm that is giving you trouble, I might be able to help guide you during its implementation. Can you go into more detail regarding the reconstruciton process?
Let me know how I can help out,
Robert