Differential distributions for heavy flavour production at HERA