Yes, this is what I was looking for. Thanks!
I tried avoiding H in C6H9. It turned out to calculate C69 giving me a wrong result. Of course, I was foolish enough to try this.

Nope :(
If the molecular formula entered is C6H9, the code should give an output equal to 12.01*6=72.06. After applying this, it's giving me 12.01*69=828.69