Updated for iPhone compatibility