Added popViewControllerAnimated with completion handler. Removed extraneous code and reorganized.