Finished item-based cf code to be used inside graphlab.