modified for iphone.