Removed ios4 supprt; added ios7 support; added new logic