add formula function to return molecular formula