Added initial swift implementation.