implemented all iOS functions