added iphone func to r