First-principles study of hydrogen storage in non-stoichiometric TiCx