now compiles for iOS. lots of issues though