updated to use latest swift changes