Updated for swift1.1
Updated for swift6.1