bunch of helping code for iOS development