Factorisation example written in Objective-C