I'm selling my out of contract iPhone 4 to a friend (their carrier is T-Mobile), was just wondering how the unlocking process worked? Does it cost money and do I need to unlock it before I upgrade to my iPhone 5 tonight? If so will anything be affected? Thanks