Updated for the most recent version of Swift.