finalize and fix commit count code