Some codes from ios tutorials