I have raised it with Feedback and have included the feedback number above. And have edited my post to include the basic code without data structures (for space reasons)
Topic:
App & System Services
SubTopic:
iCloud
Tags: