Differential distributions for heavy flavor production at HERA