Code for Yale IMs Iphone App