initial code

Here's the iOS implementation!