Updated to adopt new Swift syntax