There was not a full tutorial showing all possible situations of inventory but there were many discussions covering it all. Which part is confusing you maybe I can help.
Me, @QMcKay and @gerlandog had some very good discussions on it look for those. Due to our discussions the multiple units was derived by @emre.