Added ios implementation